[NO-ISSUE] test(webkit): browser-mode functional test suite (68 components)#716
Draft
HerbertJulio wants to merge 12 commits into
Draft
[NO-ISSUE] test(webkit): browser-mode functional test suite (68 components)#716HerbertJulio wants to merge 12 commits into
HerbertJulio wants to merge 12 commits into
Conversation
Vitest browser mode (Playwright Chromium) + @testing-library/vue + composeStories, axe-core a11y helper, theme CSS loaded in setup so contrast checks are real, publish-safe files negation (no test files in the tarball), sharded CI workflow, and root passthrough scripts. Adopts the direction validated by the #704 proposal; hardens the gaps (publish leak, unstyled-DOM a11y, pure-module coverage, CI scale).
…onfig Functional Button coverage (polymorphism, click emission, disabled/loading click-suppression, aria-busy/disabled, spinner, axe a11y) plus composeStories fixtures. Config: define process.env.NODE_ENV for @testing-library/vue in the browser, CI retry, drop the unusable @stories alias (tests use relative story paths so validate-references resolves them). Removes the bootstrap smoke test.
…onents Wave 1 — browser-mode (Chromium) functional coverage authored + self-verified per component: actions (button-highlight, mini-button, copy-button, segmented-button, icon-button), content (badge, card-box, card-pricing, currency, avatar, tag, overline), feedback (message, empty-state, status-indicator, skeleton, progress-bar, empty-results-block), inputs (label, helper-text, chip), layout (divider), navigation (link), utils (spinner). Each asserts rendering, emitted events with payloads, disabled/loading suppression, ARIA, and axe a11y; composeStories where a story exists. 419 tests green across 25 files. gitignore browser screenshots.
…ple components Wave 2 — browser-mode functional coverage: inputs (input-text, input-number, input-password, textarea, field-text, field-password, field-textarea, checkbox, radio-button, switch, field-checkbox(-block), field-radio(-block), field-switch(-block), box-grid-selection), data (code-block), navigation (menu-item, breadcrumb-item), layout (sidebar + group/header/footer). Each covers v-model round-trip, emitted events, disabled/readonly suppression, ARIA, and axe; composeStories where a story exists.
…ay & recursive components Wave 3 — browser-mode functional coverage for the hard components: composition (item, table, paginator, flow, pick-list, log-view, toast, select, multi-select, dropdown, tab-view, global-header, breadcrumb) and overlays/recursive (dialog, drawer, panel, tooltip, navigation-menu) plus calendar. Covers compound dot-notation, provide/inject shared state, emitted events, v-model, open/close + Escape + focus-trap + Teleport for overlays, nested-instance context for recursive menus, and axe a11y. One breadcrumb overflow-select test is skipped with a documented reason. Adds DOM globals (SVGElement, requestAnimationFrame, HTMLOptionElement) to eslint config for the test files.
log-view: header search testid __search-input->__search; copy moved to LogViewContent (CopyButton span) -> click inner button + stub clipboard. code-block: click CopyButton's inner button (span wrapper post-#715). empty-results-block: remove test (moved to wip/, un-exported). breadcrumb: cleanup afterEach + close overflow menu; quarantine file in vitest.config (overflow Dropdown hangs @vitest/browser teardown; 28 tests pass). Suite: 66 files / 1335 tests green, sharded, exits cleanly.
…ntined) Root cause of the hang: all 16 tests PASS and the summary prints, but vitest-browser/Playwright does not close the browser afterwards — triggered by the overflow Dropdown (Teleport + usePlacement) rendered at the mobile viewport. It is a teardown/tooling issue in the shared Dropdown/overlay, not a test defect. Rewrite drops userEvent, closes the overflow, uses axe only on non-overflow trails, and documents the FiveItems nested-interactive a11y gap. File stays excluded in vitest.config until the component teardown is fixed.
Adds @storybook/experimental-addon-test (SB 8.6) + a storybook vitest project (.storybook/vitest.setup.ts, apps/storybook/vitest.config.ts) so every story runs as a real-browser (Playwright) test and surfaces in the Storybook Testing sidebar (green/red per story). Reuses the existing @vitest/browser setup and the main.js aliases. Local run: 291/292 story-tests pass; the 1 failure (NavigationMenu 'Accessibility' story play(): aria-expanded true vs expected false) is a pre-existing story/component finding the addon now surfaces, not addressed here.
Match @storybook/experimental-addon-test to storybook core (removes the version-mismatch warning that can blank the addon manager UI).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
packages/webkitshipped with zero tests — CI only checked lint, types and the Storybook build, which proves a component declares an API but not that it works. This PR adds a functional test suite that exercises every component like a real user, in a real browser.Approach
Tab/Escape,<Teleport>, positioning and axe run against the real DOM, so tests can't pass on jsdom no-ops. Mocking layout/positioning/focus is forbidden by convention.composeStoriesfrom@storybook/vue3) — the same story powers docs and tests; no second world to maintain.*.test.tsper component, co-located with the.vue. Test files are excluded from the published package (filesnegation; verified withpack:dry).What each suite covers
Rendering &
data-testid· props/variants →data-*· every emitted event with payload on the real action ·disabled/loading/readonlysuppress interaction ·v-modelround-trip · ARIA (role,aria-expanded,aria-busy…) · composition (provide/injectdelivers shared state to sub-components) · overlays (open/close,Escape, focus-trap + restoration,Teleportto body, scroll-lock) · recursive menus (nested ≥2 levels + context) · axe a11y.Anti-flake / anti-false-positive rule: no assertions on class strings, pixels, animation timing or internal state; a test that only passes for one implementation is removed.
Coverage
~68 components across actions, content, feedback, inputs/fields, data, layout, navigation and overlays — foundation + Button + Wave 1 (24 monolithic) + Wave 2 (24 inputs/fields/simple) + Wave 3 (19 composition/overlay/recursive/calendar). ~1,300+ assertions.
breadcrumboverflow-menu select test isit.skipwith a documented reason (the Dropdown option's@select→navigatewiring couldn't be triggered under test interaction; the menu-open/option-render/href are still covered). Follow-up.onboarding-form,plan-success,platform-shell,sign-up-card) are intentionally out of scope.How it runs
pnpm webkit:test(headless Chromium)..github/workflows/test.yml— sharded (×4) + retry, runs only when webkit/storybook changes.Notes
Authored on a dedicated branch off
dev. The.claude/rules/testing.mdconventions doc will land in a separate PR (kept out of this code PR by policy). IncludesPLANEJAMENTO-TESTES.md(planning notes, PT) — can be dropped before merge if preferred.